import request from '@/utils/request'

export function selectPage(data) {
  return request({
    url: '/wordSystemWordLibrary/queryPage',
    method: 'POST',
    data
  })
}

export function analyzeWordFromJson(data) {
  return request({
    url: '/wordSystemWordLibrary/analyzeWordFromJson',
    method: 'POST',
    data
  })
}

/**
 * 批量添加单词
 * @param data
 * @returns {AxiosPromise}
 */
export function addWordBatch(data) {
  return request({
    url: '/wordSystemWordLibrary/addWordBatch',
    method: 'post',
    data
  })
}

/**
 * 新增或修改单词
 * @param data
 * @returns {AxiosPromise}
 */
export function editOrUpdateWord(data) {
  return request({
    url: '/wordSystemWordLibrary/editOrUpdateWord',
    method: 'post',
    data
  })
}

/**
 * 删除单词
 * @param data
 * @returns {AxiosPromise}
 */
export function deleteWord(params) {
  return request({
    url: '/wordSystemWordLibrary/deleteById',
    method: 'post',
    params
  })
}
